package com.it.schoolbookshop_back.enums;

/**
 * 价格区间枚举
 */
public enum PriceRangeEnum {
    BELOW_20("20以下", 0.0, 20.0),
    RANGE_20_50("20-50", 20.0, 50.0),
    RANGE_50_100("50-100", 50.0, 100.0),
    ABOVE_100("100以上", 100.0, null);

    private final String label;
    private final Double min;
    private final Double max;

    PriceRangeEnum(String label, Double min, Double max) {
        this.label = label;
        this.min = min;
        this.max = max;
    }

    public String getLabel() { return label; }
    public Double getMin() { return min; }
    public Double getMax() { return max; }

    public static PriceRangeEnum fromLabel(String label) {
        for (PriceRangeEnum e : values()) {
            if (e.label.equals(label)) {
                return e;
            }
        }
        return null;
    }
} 